package squares;

import be.kuleuven.cs.som.annotate.Basic;
/**
 * An exception class that is thrown if the given temperature is not contained within the minimum and 
 * maximum Temperature of its square
 * 
 * @version 1
 * @author 	Gilles Groven & Jochen Tombal
 */

public class InvalidTemperatureException extends Exception{
	
	/**
	 * A version number for classes that implement the interface
	 * Serializable wich is strongly recommends by Java API
	 */
	private static final long serialVersionUID = 122748396126538621L;
	
	/**
	 * Variable registering the value of the temperature.
	 */
	private final double temperature;
	
	/**
	 * Initializes this new invalid temperature exception with the given value
	 * 
	 * @param 	temperature
	 * 			The value of this new invalid temperature exception
	 * @post	The temperature of this new invalid temperature exception
	 * @effect	The exception is invoked when the given temperature is not contained within the minimum and 
	 * 			maximum Temperature of its square
	 */
	public InvalidTemperatureException(double temperature)
	{
		this.temperature = temperature;
	}
	/**
	 * @return The temperature that caused this exception
	 */
	@Basic
	public double getTemperature()
	{
		return temperature;
	}

}
